﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Physic = StillDesign.PhysX; //PhysX
using PhysicMath = StillDesign.PhysX.MathPrimitives; //PhysX

namespace Game
{
    /*-------------------------------------------------------------------------
    | IDKToPhysic:
    | ------------
    | Conversion helper
    |---------------------------------------------------------------------------*/
    static class IDKToPhysic
    {
        static public IDK.Quaternion ToQuaternion(PhysicMath.Quaternion q)
        {
            return new IDK.Quaternion(q.W, -q.X, -q.Y, -q.Z);
        }

        static public PhysicMath.Quaternion ToQuaternion(IDK.Quaternion q)
        {
            return new PhysicMath.Quaternion(-q.x, -q.y, -q.z, q.w);
        }

        static public IDK.Vector3 ToVector3(PhysicMath.Vector3 v)
        {
            return new IDK.Vector3(v.X, v.Y, v.Z);
        }

        static public PhysicMath.Vector3 ToVector3(IDK.Vector3 v)
        {
            return new PhysicMath.Vector3(v.x, v.y, v.z);
        }

        static public PhysicMath.Vector3 ToVector3(float x, float y, float z)
        {
            return new PhysicMath.Vector3(x, y, z);
        }

        static public IDK.Vector2 ToVector2(PhysicMath.Vector2 v)
        {
            return new IDK.Vector2(v.X, v.Y);
        }

        static public PhysicMath.Vector2 ToVector2(IDK.Vector2 v)
        {
            return new PhysicMath.Vector2(v.x, v.y);
        }

        static public float Radians(float degrees)
        {
            return degrees * ((float)Math.PI / 180f);
        }
    }
}
